package omq.xml.element;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Ofer Misk
 *
 */
public class OMQXmlElement {
	String id;
	String elementName;
	Map attrs;
	Map elements;
	String nodeValue;
	
	/*****************************************************
	 * 						CONSTRUCTOR					 *
	 *****************************************************/
	 public OMQXmlElement(){
		 attrs = new HashMap();
		 elements = new HashMap();
	 }
	 public OMQXmlElement(String id,String elementName,Map attrs,Map elements,String nodeValue){
		 attrs = new HashMap();
		 elements = new HashMap();
		 this.id = id;
		 this.elementName = elementName;
		 this.attrs = attrs;
		 this.elements = elements;
		 this.nodeValue = nodeValue;
	 }
	
	/*****************************************************
	 * 						SETTERS						 *
	 *****************************************************/
	public void setAttrs(Map attrs) {
		this.attrs = attrs;
	}
	
	public void setElementName(String elementName) {
		this.elementName = elementName;
	}
	
	public void setElements(Map elements) {
		this.elements = elements;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public void setNodeValue(String nodeValue) {
		this.nodeValue = nodeValue;
	}
	/*****************************************************
	 * 						GETTERS						 *
	 *****************************************************/	
	public Map getAttrs() {
		return attrs;
	}
	
	public String getElementName() {
		return elementName;
	}
	
	public Map getElements() {
		return elements;
	}
	
	public String getId() {
		return id;
	}
	
	public String getNodeValue() {
		return nodeValue;
	}
	/*****************************************************
	 * 						UTILS						 *
	 *****************************************************/	
	public void addElement(OMQXmlElement element){
		getElements().put(element.getElementName(),element);
	}
	
	public void addAttr(String attrName,String attrValue){
		getAttrs().put(attrName,attrValue);
	}
}
